package com.googlecode.gingerman.world.geometry;

import java.util.ArrayList;

public class Polygon extends Figure {
	protected ArrayList<Vector> vertices;

	public Polygon(Coordinates center, ArrayList<Vector> vertices) {
		super(center);
		this.vertices = vertices;
	}

	public ArrayList<Vector> getVertices() {
		return vertices;
	}

	public void rotate(double angle) {
		ArrayList<Vector> newVertices = new ArrayList<Vector>();
		for (int i = 1; i < vertices.size(); i++) {
			Vector element = vertices.get(i);
			double newAngle = element.getAngle() + angle;
			element = new Vector(newAngle, element.getLength());
			newVertices.add(element);
		}
		vertices = newVertices;
	}

	public void scale(double scale) {
		ArrayList<Vector> newVertices = new ArrayList<Vector>();
		for (int i = 1; i < vertices.size(); i++) {
			Vector element = vertices.get(i);
			double newLength = element.getLength() * scale;
			element = new Vector(element.getAngle(), newLength);
			newVertices.add(element);
		}
		vertices = newVertices;
	}

	public boolean containsPoint(Coordinates point) {
		return false;
	}

	public boolean intersectFigure(Figure figure) {
		return false;
	}

}
